package org.sample.pattern.proxy.stc;

import org.sample.pattern.proxy.service.Service;

/** 代理模式的静态代码实现 */
public class ProxyServiceStcImpl implements Service {

    private Service service;

    public ProxyServiceStcImpl(Service service) {
        this.service = service;
    }

    @Override
    public String request(String message) {
        log(message);
        String result = service.request(message);
        log(result);
        return result;
    }

    private void log(String message) {
        System.out.println("log:message=" + message);
    }
}